import "reflect-metadata";

function requestDecorator(methodType: string) {
  return function (reqPath?: string): MethodDecorator {
    return (targetClassPrototype, methodname, descriptor) => {
      console.log("方法装饰器--", reqPath);
      Reflect.defineMetadata("path", reqPath, targetClassPrototype, methodname);
      Reflect.defineMetadata(
        "methodType",
        methodType,
        targetClassPrototype,
        methodname
      );
    };
  };
}
export const get = requestDecorator("get");
export const post = requestDecorator("post");
